home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / AppleTalk.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  14.4 KB  |  518 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleTalk.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  18. __APPLETALK__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  27.     include 'OSUtils.a'
  28.     ENDIF
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'Memory.a'                                            ;
  31.  
  32. ; Driver unit and reference numbers (ADSP is dynamic) 
  33. mppUnitNum                        EQU        9                    ; MPP unit number 
  34. atpUnitNum                        EQU        10                    ; ATP unit number 
  35. xppUnitNum                        EQU        40                    ; XPP unit number 
  36. mppRefNum                        EQU        -10                    ; MPP reference number 
  37. atpRefNum                        EQU        -11                    ; ATP reference number 
  38. xppRefNum                        EQU        -41                    ; XPP reference number 
  39. ; .MPP csCodes 
  40. lookupReply                        EQU        242                    ; This command queued to ourself 
  41. writeLAP                        EQU        243                    ; Write out LAP packet 
  42. detachPH                        EQU        244                    ; Detach LAP protocol handler 
  43. attachPH                        EQU        245                    ; Attach LAP protocol handler 
  44. writeDDP                        EQU        246                    ; Write out DDP packet 
  45. closeSkt                        EQU        247                    ; Close DDP socket 
  46. openSkt                            EQU        248                    ; Open DDP socket 
  47. loadNBP                            EQU        249                    ; Load NBP command-executing code 
  48. lastResident                    EQU        249                    ; Last resident command 
  49. confirmName                        EQU        250                    ; Confirm name 
  50. lookupName                        EQU        251                    ; Look up name on internet 
  51. removeName                        EQU        252                    ; Remove name from Names Table 
  52. registerName                    EQU        253                    ; Register name in Names Table 
  53. killNBP                            EQU        254                    ; Kill outstanding NBP request 
  54.  
  55. unloadNBP                        EQU        255                    ; Unload NBP command code 
  56. setSelfSend                        EQU        256                    ; MPP: Set to allow writes to self 
  57. SetMyZone                        EQU        257                    ; Set my zone name 
  58. GetATalkInfo                    EQU        258                    ; get AppleTalk information 
  59. ATalkClosePrep                    EQU        259                    ; AppleTalk close query 
  60. ; .ATP csCodes 
  61. nSendRequest                    EQU        248                    ; NSendRequest code 
  62. relRspCB                        EQU        249                    ; Release RspCB 
  63. closeATPSkt                        EQU        250                    ; Close ATP socket 
  64. addResponse                        EQU        251                    ; Add response code | Require open skt 
  65. sendResponse                    EQU        252                    ; Send response code 
  66. getRequest                        EQU        253                    ; Get request code 
  67. openATPSkt                        EQU        254                    ; Open ATP socket 
  68. sendRequest                        EQU        255                    ; Send request code 
  69. relTCB                            EQU        256                    ; Release TCB 
  70. killGetReq                        EQU        257                    ; Kill GetRequest 
  71. killSendReq                        EQU        258                    ; Kill SendRequest 
  72. killAllGetReq                    EQU        259                    ; Kill all getRequests for a skt 
  73. ; .XPP csCodes 
  74. openSess                        EQU        255                    ; Open session 
  75. closeSess                        EQU        254                    ; Close session 
  76. userCommand                        EQU        253                    ; User command 
  77.  
  78. userWrite                        EQU        252                    ; User write 
  79. getStatus                        EQU        251                    ; Get status 
  80. afpCall                            EQU        250                    ; AFP command (buffer has command code) 
  81. getParms                        EQU        249                    ; Get parameters 
  82. abortOS                            EQU        248                    ; Abort open session request 
  83. closeAll                        EQU        247                    ; Close all open sessions 
  84. xCall                            EQU        246                    ; .XPP extended calls 
  85. ; Transition Queue transition types 
  86. ATTransOpen                        EQU        0                    ;AppleTalk has opened
  87. ATTransClose                    EQU        2                    ;AppleTalk is about to close
  88. ATTransClosePrep                EQU        3                    ;Is it OK to close AppleTalk ?
  89. ATTransCancelClose                EQU        4                    ;Cancel the ClosePrep transition
  90. afpByteRangeLock                EQU        1                    ;AFPCall command codes
  91. afpVolClose                        EQU        2                    ;AFPCall command codes
  92. afpDirClose                        EQU        3                    ;AFPCall command codes
  93. afpForkClose                    EQU        4                    ;AFPCall command codes
  94. afpCopyFile                        EQU        5                    ;AFPCall command codes
  95. afpDirCreate                    EQU        6                    ;AFPCall command codes
  96. afpFileCreate                    EQU        7                    ;AFPCall command codes
  97. afpDelete                        EQU        8                    ;AFPCall command codes
  98. afpEnumerate                    EQU        9                    ;AFPCall command codes
  99.  
  100. afpFlush                        EQU        10                    ;AFPCall command codes
  101. afpForkFlush                    EQU        11                    ;AFPCall command codes
  102. afpGetDirParms                    EQU        12                    ;AFPCall command codes
  103. afpGetFileParms                    EQU        13                    ;AFPCall command codes
  104. afpGetForkParms                    EQU        14                    ;AFPCall command codes
  105. afpGetSInfo                        EQU        15                    ;AFPCall command codes
  106. afpGetSParms                    EQU        16                    ;AFPCall command codes
  107. afpGetVolParms                    EQU        17                    ;AFPCall command codes
  108. afpLogin                        EQU        18                    ;AFPCall command codes
  109. afpContLogin                    EQU        19                    ;AFPCall command codes
  110. afpLogout                        EQU        20                    ;AFPCall command codes
  111. afpMapID                        EQU        21                    ;AFPCall command codes
  112. afpMapName                        EQU        22                    ;AFPCall command codes
  113. afpMove                            EQU        23                    ;AFPCall command codes
  114. afpOpenVol                        EQU        24                    ;AFPCall command codes
  115. afpOpenDir                        EQU        25                    ;AFPCall command codes
  116. afpOpenFork                        EQU        26                    ;AFPCall command codes
  117. afpRead                            EQU        27                    ;AFPCall command codes
  118. afpRename                        EQU        28                    ;AFPCall command codes
  119. afpSetDirParms                    EQU        29                    ;AFPCall command codes
  120.  
  121. afpSetFileParms                    EQU        30                    ;AFPCall command codes
  122. afpSetForkParms                    EQU        31                    ;AFPCall command codes
  123. afpSetVolParms                    EQU        32                    ;AFPCall command codes
  124. afpWrite                        EQU        33                    ;AFPCall command codes
  125. afpGetFlDrParms                    EQU        34                    ;AFPCall command codes
  126. afpSetFlDrParms                    EQU        35                    ;AFPCall command codes
  127. afpDTOpen                        EQU        48                    ;AFPCall command codes
  128. afpDTClose                        EQU        49                    ;AFPCall command codes
  129. afpGetIcon                        EQU        51                    ;AFPCall command codes
  130. afpGtIcnInfo                    EQU        52                    ;AFPCall command codes
  131. afpAddAPPL                        EQU        53                    ;AFPCall command codes
  132. afpRmvAPPL                        EQU        54                    ;AFPCall command codes
  133. afpGetAPPL                        EQU        55                    ;AFPCall command codes
  134. afpAddCmt                        EQU        56                    ;AFPCall command codes
  135. afpRmvCmt                        EQU        57                    ;AFPCall command codes
  136. afpGetCmt                        EQU        58                    ;AFPCall command codes
  137. afpAddIcon                        EQU        192                    ;Special code for ASP Write commands
  138. xppLoadedBit                    EQU        5                    ; XPP bit in PortBUse 
  139. scbMemSize                        EQU        192                    ; Size of memory for SCB 
  140. xppFlagClr                        EQU        0                    ; Cs for AFPCommandBlock 
  141.  
  142. xppFlagSet                        EQU        128                    ; StartEndFlag & NewLineFlag fields. 
  143. lapSize                            EQU        20
  144. ddpSize                            EQU        26
  145. nbpSize                            EQU        26
  146. atpSize                            EQU        56
  147. atpXOvalue                        EQU        32                    ;ATP exactly-once bit 
  148. atpEOMvalue                        EQU        16                    ;ATP End-Of-Message bit 
  149. atpSTSvalue                        EQU        8                    ;ATP Send-Transmission-Status bit 
  150. atpTIDValidvalue                EQU        2                    ;ATP trans. ID valid bit 
  151. atpSendChkvalue                    EQU        1                    ;ATP send checksum bit 
  152. zipGetLocalZones                EQU        5
  153. zipGetZoneList                    EQU        6
  154. zipGetMyZone                    EQU        7
  155. LAPMgrPtr                        EQU        $B18                ;Entry point for LAP Manager
  156. LAPMgrCall                        EQU        2                    ;Offset to LAP routines
  157. LAddAEQ                            EQU        23                    ;LAPAddATQ routine selector
  158. LRmvAEQ                            EQU        24                    ;LAPRmvATQ routine selector
  159.  
  160. tLAPRead                        EQU        0
  161. tLAPWrite                        EQU        1
  162. tDDPRead                        EQU        2
  163. tDDPWrite                        EQU        3
  164. tNBPLookup                        EQU        4
  165. tNBPConfirm                        EQU        5
  166. tNBPRegister                    EQU        6
  167. tATPSndRequest                    EQU        7
  168. tATPGetRequest                    EQU        8
  169. tATPSdRsp                        EQU        9
  170. tATPAddRsp                        EQU        10
  171. tATPRequest                        EQU        11
  172. tATPResponse                    EQU        12
  173.  
  174. lapProto                        EQU        0
  175. ddpProto                        EQU        1
  176. nbpProto                        EQU        2
  177. atpProto                        EQU        3
  178.  
  179. LAPAdrBlock             RECORD    0
  180. dstNodeID                 ds.b    1
  181. srcNodeID                 ds.b    1
  182. lapProtType                 ds.b    1
  183. filler                     ds.b    1                                    ;    Filler for proper byte alignment
  184. sizeof                     EQU    4
  185.                         ENDR
  186.  
  187. ATQEntry                 RECORD    0
  188. qLink                     ds.l    1                                    ;next queue entry
  189. qType                     ds.w    1                                    ;queue type
  190. CallAddr                 ds.l    1                                    ;your routine descriptor
  191. sizeof                     EQU    10
  192.                         ENDR
  193.  
  194. AddrBlock                 RECORD    0
  195. aNet                     ds.w    1
  196. aNode                     ds.b    1
  197. aSocket                     ds.b    1
  198. sizeof                     EQU    4
  199.                         ENDR
  200.  
  201. ; Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  202. ;offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  203. ;In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  204. ;only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  205. ;be the same, which is OK since they are not used. 
  206. EntityName                 RECORD    0
  207. objStr                     ds.b    33
  208. pad1                     ds.b    1                                    ;Str32's aligned on even word boundries.
  209. typeStr                     ds.b    33
  210. pad2                     ds.b    1
  211. zoneStr                     ds.b    33
  212. pad3                     ds.b    1
  213. sizeof                     EQU    102
  214.                         ENDR
  215.  
  216. RetransType             RECORD    0
  217. retransInterval             ds.b    1
  218. retransCount             ds.b    1
  219. sizeof                     EQU    2
  220.                         ENDR
  221.  
  222. BDSElement                 RECORD    0
  223. buffSize                 ds.w    1
  224. buffPtr                     ds.l    1
  225. dataSize                 ds.w    1
  226. userBytes                 ds.l    1
  227. sizeof                     EQU    12
  228.                         ENDR
  229.  
  230. ATLAPRec                 RECORD    0
  231. abOpcode                 ds.b    1
  232. filler                     ds.b    1                                    ;    Filler for proper byte alignment
  233. abResult                 ds.w    1
  234. abUserReference             ds.l    1
  235. lapAddress                 ds        LAPAdrBlock
  236. lapReqCount                 ds.w    1
  237. lapActCount                 ds.w    1
  238. lapDataPtr                 ds.l    1
  239. sizeof                     EQU    20
  240.                         ENDR
  241.  
  242. ATDDPRec                 RECORD    0
  243. abOpcode                 ds.b    1
  244. filler                     ds.b    1                                    ;    Filler for proper byte alignment
  245. abResult                 ds.w    1
  246. abUserReference             ds.l    1
  247. ddpType                     ds.w    1
  248. ddpSocket                 ds.w    1
  249. ddpAddress                 ds        AddrBlock
  250. ddpReqCount                 ds.w    1
  251. ddpActCount                 ds.w    1
  252. ddpDataPtr                 ds.l    1
  253. ddpNodeID                 ds.w    1
  254. sizeof                     EQU    26
  255.                         ENDR
  256.  
  257. ATNBPRec                 RECORD    0
  258. abOpcode                 ds.b    1
  259. filler                     ds.b    1                                    ;    Filler for proper byte alignment
  260. abResult                 ds.w    1
  261. abUserReference             ds.l    1
  262. nbpEntityPtr             ds.l    1
  263. nbpBufPtr                 ds.l    1
  264. nbpBufSize                 ds.w    1
  265. nbpDataField             ds.w    1
  266. nbpAddress                 ds        AddrBlock
  267. nbpRetransmitInfo         ds        RetransType
  268. sizeof                     EQU    26
  269.                         ENDR
  270.  
  271. ATATPRec                 RECORD    0
  272. abOpcode                 ds.b    1
  273. filler1                     ds.b    1                                    ;    Filler for proper byte alignment
  274. abResult                 ds.w    1
  275. abUserReference             ds.l    1
  276. atpSocket                 ds.w    1
  277. atpAddress                 ds        AddrBlock
  278. atpReqCount                 ds.w    1
  279. atpDataPtr                 ds.l    1
  280. atpRspBDSPtr             ds.l    1
  281. atpBitMap                 ds.b    1
  282. filler2                     ds.b    1                                    ;    Filler for proper byte alignment
  283. atpTransID                 ds.w    1
  284. atpActCount                 ds.w    1
  285. atpUserData                 ds.l    1
  286. atpXO                     ds.b    1
  287. atpEOM                     ds.b    1
  288. atpTimeOut                 ds.w    1
  289. atpRetries                 ds.w    1
  290. atpNumBufs                 ds.w    1
  291. atpNumRsp                 ds.w    1
  292. atpBDSSize                 ds.w    1
  293. atpRspUData                 ds.l    1
  294. atpRspBuf                 ds.l    1
  295. atpRspSize                 ds.w    1
  296. sizeof                     EQU    56
  297.                         ENDR
  298.  
  299. AFPCommandBlock         RECORD    0
  300. cmdByte                     ds.b    1
  301. startEndFlag             ds.b    1
  302. forkRefNum                 ds.w    1
  303. rwOffset                 ds.l    1
  304. reqCount                 ds.l    1
  305. newLineFlag                 ds.b    1
  306. newLineChar                 ds.b    1
  307. sizeof                     EQU    14
  308.                         ENDR
  309.  
  310. WDSElement                 RECORD    0
  311. entryLength                 ds.w    1
  312. entryPtr                 ds.l    1
  313. sizeof                     EQU    6
  314.                         ENDR
  315.  
  316. NTElement                 RECORD    0
  317. nteAddress                 ds        AddrBlock                            ;network address of entity
  318. filler                     ds.b    1
  319. entityData                 ds.b    99                                ;Object, Type & Zone
  320. sizeof                     EQU    104
  321.                         ENDR
  322.  
  323. NamesTableEntry         RECORD    0
  324. qNext                     ds.l    1                                    ;ptr to next NTE
  325. nt                         ds        NTElement
  326. sizeof                     EQU    108
  327.                         ENDR
  328.  
  329. MPPParamBlock             RECORD    0
  330. qLink                     ds.l    1
  331. qType                     ds.w    1
  332. ioTrap                     ds.w    1
  333. ioCmdAddr                 ds.l    1
  334. ioCompletion             ds.l    1
  335. ioResult                 ds.w    1
  336. userData                 ds.l    1
  337. reqTID                     ds.w    1
  338. ioRefNum                 ds.w    1
  339. csCode                     ds.w    1
  340. VariantLevel0Begin        EQU    *
  341. filler0                     ds.w    1
  342. wdsPointer                 ds.l    1
  343.  
  344.                         ORG        VariantLevel0Begin
  345. protType                 ds.b    1
  346. filler                     ds.b    1
  347. handler                     ds.l    1
  348.  
  349.                         ORG        VariantLevel0Begin
  350. socket                     ds.b    1
  351. checksumFlag             ds.b    1
  352. listener                 ds.l    1
  353.  
  354.                         ORG        VariantLevel0Begin
  355. interval                 ds.b    1                                    ;retry interval 
  356. count                     ds.b    1                                    ;retry count 
  357. nbpPtrs                     ds.l    1
  358. VariantLevel1Begin        EQU    *
  359. verifyFlag                 ds.b    1
  360. filler3                     ds.b    1
  361.  
  362.                         ORG        VariantLevel1Begin
  363. retBuffPtr                 ds.l    1
  364. retBuffSize                 ds.w    1
  365. maxToGet                 ds.w    1
  366. numGotten                 ds.w    1
  367.  
  368.                         ORG        VariantLevel1Begin
  369. confirmAddr                 ds        AddrBlock
  370. newSocket                 ds.b    1
  371. filler4                     ds.b    1
  372.  
  373.  
  374.                         ORG        VariantLevel0Begin
  375. newSelfFlag                 ds.b    1                                    ;self-send toggle flag 
  376. oldSelfFlag                 ds.b    1                                    ;previous self-send state 
  377.  
  378.                         ORG        VariantLevel0Begin
  379. nKillQEl                 ds.l    1                                    ;ptr to i/o queue element to cancel 
  380.  
  381.                         ORG        VariantLevel0Begin
  382. version                     ds.w    1
  383. varsPtr                     ds.l    1
  384. DCEPtr                     ds.l    1
  385. portID                     ds.w    1
  386. configuration             ds.l    1
  387. selfSend                 ds.w    1
  388. netLo                     ds.w    1
  389. netHi                     ds.w    1
  390. ourAdd                     ds.l    1
  391. routerAddr                 ds.l    1
  392. numOfPHs                 ds.w    1
  393. numOfSkts                 ds.w    1
  394. numNBPEs                 ds.w    1
  395. nTQueue                     ds.l    1
  396. LAlength                 ds.w    1
  397. linkAddr                 ds.l    1
  398. zoneName                 ds.l    1
  399.  
  400.                         ORG        VariantLevel0Begin
  401. appName                     ds.l    1                                    ;pointer to application name in buffer
  402.  
  403. sizeof                     EQU    78
  404.                         ENDR
  405.  
  406. XPPParamBlock             RECORD    0
  407. qLink                     ds.l    1
  408. qType                     ds.w    1
  409. ioTrap                     ds.w    1
  410. ioCmdAddr                 ds.l    1
  411. ioCompletion             ds.l    1
  412. ioResult                 ds.w    1
  413. cmdResult                 ds.l    1
  414. ioVRefNum                 ds.w    1
  415. ioRefNum                 ds.w    1
  416. csCode                     ds.w    1
  417. VariantLevel0Begin        EQU    *
  418. abortSCBPtr                 ds.l    1                                    ; SCB pointer for AbortOS
  419.  
  420.                         ORG        VariantLevel0Begin
  421. aspMaxCmdSize             ds.w    1
  422. aspQuantumSize             ds.w    1
  423. numSesss                 ds.w    1
  424.  
  425.                         ORG        VariantLevel0Begin
  426. sessRefnum                 ds.w    1
  427. aspTimeout                 ds.b    1
  428. aspRetry                 ds.b    1
  429. VariantLevel1Begin        EQU    *
  430. serverAddr                 ds        AddrBlock
  431. scbPointer                 ds.l    1
  432. attnRoutine                 ds.l    1
  433.  
  434.                         ORG        VariantLevel1Begin
  435. cbSize                     ds.w    1
  436. cbPtr                     ds.l    1
  437. rbSize                     ds.w    1
  438. rbPtr                     ds.l    1
  439. VariantLevel2Begin        EQU    *
  440. afpAddrBlock             ds        AddrBlock
  441. afpSCBPtr                 ds.l    1
  442. afpAttnRoutine             ds.l    1
  443.  
  444.                         ORG        VariantLevel2Begin
  445. wdSize                     ds.w    1
  446. wdPtr                     ds.l    1
  447. ccbStart                 ds.b    296
  448.  
  449.  
  450.  
  451.                         ORG        VariantLevel0Begin
  452. xppSubCode                 ds.w    1
  453. xppTimeout                 ds.b    1
  454. xppRetry                 ds.b    1
  455. filler1                     ds.w    1
  456. zipBuffPtr                 ds.l    1
  457. zipNumZones                 ds.w    1
  458. zipLastFlag                 ds.b    1
  459. filler2                     ds.b    1
  460. zipInfoField             ds.b    70
  461.  
  462. sizeof                     EQU    346
  463.                         ENDR
  464.  
  465. ATPParamBlock             RECORD    0
  466. qLink                     ds.l    1
  467. qType                     ds.w    1
  468. ioTrap                     ds.w    1
  469. ioCmdAddr                 ds.l    1
  470. ioCompletion             ds.l    1
  471. ioResult                 ds.w    1
  472. userData                 ds.l    1
  473. reqTID                     ds.w    1
  474. ioRefNum                 ds.w    1
  475. csCode                     ds.w    1
  476. atpSocket                 ds.b    1
  477. atpFlags                 ds.b    1
  478. addrBlock                 ds        AddrBlock
  479. reqLength                 ds.w    1
  480. reqPointer                 ds.l    1
  481. bdsPointer                 ds.l    1
  482. VariantLevel0Begin        EQU    *
  483. numOfBuffs                 ds.b    1
  484. timeOutVal                 ds.b    1
  485. numOfResps                 ds.b    1
  486. retryCount                 ds.b    1
  487. intBuff                     ds.w    1
  488. TRelTime                 ds.b    1
  489. filler0                     ds.b    1
  490.  
  491.                         ORG        VariantLevel0Begin
  492. filler                     ds.b    1
  493. bdsSize                     ds.b    1
  494. transID                     ds.w    1
  495.  
  496.                         ORG        VariantLevel0Begin
  497. bitMap                     ds.b    1
  498. filler2                     ds.b    1
  499.  
  500.                         ORG        VariantLevel0Begin
  501. rspNum                     ds.b    1
  502. filler3                     ds.b    1
  503.  
  504.                         ORG        VariantLevel0Begin
  505. aKillQEl                 ds.l    1
  506.  
  507. sizeof                     EQU    52
  508.                         ENDR
  509.  
  510. ;
  511. ;    The following routines are obsolete and will not be supported on
  512. ;    PowerPC. Equivalent functionality is provided by the routines
  513. ;    above.
  514. ;
  515.     IF OLDROUTINENAMES  ** ¬ GENERATINGCFM  THEN
  516.     ENDIF
  517.     ENDIF ; __APPLETALK__
  518.